<?php
/*
 * 
 * on a déjà ajouté :
 * 		des types de produits
 * 		des produits
 * 		des utilisateurs
 * 		des commandes
 * 		des articles
 * 		des articles_commandes
 * 
 * on ajoute :
 * 		des opérations
 */

namespace Drinkiit\BlogBundle\DataFixtures\ORM;


use Doctrine\Common\DataFixtures\OrderedFixtureInterface;
use Doctrine\Common\DataFixtures\AbstractFixture;
use Doctrine\Common\Persistence\ObjectManager;

use Drinkiit\BlogBundle\Entity\Operations;

class LoadOperationData extends AbstractFixture implements OrderedFixtureInterface {
	
    public function load(ObjectManager $manager)
    {
		$operation1 = new Operations();
		$operation1->setDate(date_create("2012-05-10"));
		$operation1->setOperationUtilisateur($manager->merge($this->getReference('dwarf')));
		$operation1->setOperation(2000);
		$operation1->setOperationCommande($manager->merge($this->getReference('commande1')));
		$manager->persist($operation1);
		
		$operation2 = new Operations();
		$operation2->setDate(date_create("2012-05-09"));
		$operation2->setOperationUtilisateur($manager->merge($this->getReference('TEAM6767')));
		$operation2->setOperation(2000);
		$operation2->setOperationCommande($manager->merge($this->getReference('commande2')));
		$manager->persist($operation2);
		
		$operation3 = new Operations();
		$operation3->setDate(date_create("2012-05-11"));
		$operation3->setOperationUtilisateur($manager->merge($this->getReference('eclair')));
		$operation3->setOperation(2000);
		$operation3->setOperationCommande($manager->merge($this->getReference('commande3')));
		$manager->persist($operation3);
		
		$manager->flush() ;
	}
	
	
	public function getOrder()
    {
        return 5; 
    }
	
}

?>
